package com.example.common.dto.user;

import com.example.common.dto.base.IVerify;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.Assert;

/**
 * @author huangjie
 */
@Data
public class UserDto implements IVerify {
    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("密码")
    private String password;

    @Override
    public void verify(boolean isUpdate){
        Assert.notNull(name,"姓名不能为空");
        Assert.notNull(phone,"手机号码不能为空");
        Assert.notNull(password,"密码不能为空");
    }
}
